﻿<!DOCTYPE html>
<html ng-app="demoApp" lang="en">
<head>
    <meta name="keywords" content="AngularJS Calendar, Month Calendar, MonthCalendar, DateTimeInput, DateTimePicker, Date Picker" />
    <meta name="description" content="AngularJS DateTime Input example. Date Formatting is demonstrated" /> 
    <title id='Description'>AngularJS DateTimeInput has built-in date parsing functionality that allows you to
     display date feedback in a variety of ways. Choose a date format from the dropdown to apply it to the jqxDateTimeInput. </title>
    <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../../scripts/angular.min.js"></script> <script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxtooltip.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/globalization/globalize.js"></script>
      <script type="text/javascript" src="../../../jqwidgets/jqxangular.js"></script>
  
    <script type="text/javascript">
        var demoApp = angular.module("demoApp", ["jqwidgets"]);
        demoApp.controller("demoController", function ($scope) {
            $scope.dateTimeInputSettings = {
                width: '300px', height: '25px', formatString: 'd'
            };

            $scope.select = function (event) {
                var index = event.args.index;
                switch (index) {
                    case 0:
                        $scope.dateTimeInputSettings.formatString = 'd';
                        break;
                    case 1:
                        $scope.dateTimeInputSettings.formatString = 'D';
                        break;
                    case 2:
                        $scope.dateTimeInputSettings.formatString = 't';
                        break;
                    case 3:
                        $scope.dateTimeInputSettings.formatString = 'T';
                        break;
                    case 4:
                        $scope.dateTimeInputSettings.formatString = 'f';
                        break;
                    case 5:
                        $scope.dateTimeInputSettings.formatString = 'F';
                        break;
                    case 6:
                        $scope.dateTimeInputSettings.formatString = 'M';
                        break;
                    case 7:
                        $scope.dateTimeInputSettings.formatString = 'Y';
                        break;
                    case 8:
                        $scope.dateTimeInputSettings.formatString = 'dddd-MMMM-yyyy';
                        break;
                }
            };
        });
    </script>
</head>
<body ng-controller="demoController">
    <jqx-date-time-input jqx-watch="dateTimeInputSettings.formatString" jqx-settings="dateTimeInputSettings"></jqx-date-time-input>
    <br />
    <div>
        <div style='font-family: "Verdana", "sans-serif"; font-size: 13px;'>
            Choose Format:
        </div>
        <br />
        <jqx-drop-down-list jqx-width="230" jqx-height="25" jqx-selected-index="0" jqx-on-select="select($event)" jqx-source="['short date pattern', 'long date pattern', 'short time pattern', 'long time pattern',
                'long date, short time pattern', 'long date, long time pattern', 'month/day pattern', 'month/year pattern', 'custom']">
                </jqx-drop-down-list>
    </div>
</body>
</html>
